{extends file="./main.tpl"}
{block name=head}
<script type="text/javascript">
$(document).ready(function(){
	$('.totalAmont').blur(function(){
		
		var amount         = $('#amount').val();
  	var interst        = $('#interst').val();
  	var totalRs        = 0;
  	
  	totalRs = parseFloat(amount)   - parseFloat(interst);
  	$('#totalAmount').val(totalRs);
});
});

</script>
{/block}
{block name=body}
<form name="party" id="party" method="POST" action="{$smarty.server.PHP_SELF}">
<table align="center">
<td valign="top">
<table border="1" align="center" cellpadding="1" cellspacing="1">
<tr>	
	<th colspan=2 class="table1">Loan</th>
</tr>
<tr>
	<td>Party : </td>
	<td>
    <select name="partyId">
      <option value="0">Party Name</option>
      {html_options values=$partyArray.partyId output=$partyArray.partyName}
    </select>
   <input type="text" name="partyName" placeholder="Enter New Party"></td>
</tr>
<tr>
	<td>Phone Number: </td>
	<td><input type="text" name="phoneNumber" required></td>
</tr>
<tr>
	<td>Date: </td>
	<td>{html_select_date prefix="loanDate" start_year="-1" end_year="+0" field_order="DMY" day_value_format="%02d"}</td>
</tr>
<tr>
	<td>Amount: </td>
	<td><input type="text" name="amount" id="amount" class="totalAmont"></td>
</tr>
<tr>
	<td>Interst : </td>
	<td><input type="text" name="interst" id="interst" class="totalAmont"></td>
</tr>
<tr>
	<td>Given Amount : </td>
	<td><input type="text" name="givenAmount" id="totalAmount" class="totalAmont"></td>
</tr>
<tr>
	<td colspan="2" align="center" class="table1"><input type="submit" name="submitBtn" class="button" value="Submit" /></td>
</tr>
</table>
</td>
</form>
{/block}